<template>
	<el-dialog class="v-dialog" v-bind="$attrs" v-on="$listeners" :visible.sync="option.show">
		<slot></slot>
		<!--<el-divider></el-divider>-->
		<span slot="footer" class="dialog-footer">
			<slot name="footer">
				<el-button size="small" @click="option.show = false">取 消</el-button>
				<el-button type="primary" size="small" @click="handleConfirm">确 定</el-button>
			</slot>
		</span>
	</el-dialog>
</template>

<script>
export default {
	name:'v-dialog',
	inheritAttrs:false,
	props: {
		option:{
			type: Object,
			default:() => ({
				show:false
			})
		},
		confirm:{
			type:Function,
			default:() => {}
		}
	},
	methods: {
		async handleConfirm() {
			await this.confirm()
		}
	},
};
</script>
<style lang="scss" scoped>
	@import './style';
</style>
